const { defineConfig } = require("@vue/cli-service")

const { resolve } = require("path")

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  chainWebpack: (config) => {
    // 配置别名
    config.resolve.alias.set("@", resolve("src"))
  },
  css: {
    loaderOptions: {
      sass: {
        // sass-loader 版本过高，config 配置发生变化
        additionalData: `
          @import "@/style/variable.scss";
        `
      }
    }
  },
  devServer:{
    host:'0.0.0.0',
    open:true,
    client: {
      overlay: false,
    },
    proxy: {
      '/dev_api': {
        // target: 'http://127.0.0.1:3001/',
        target: 'http://8.153.36.96:3001/',
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          '^/dev_api': ''
        }
      },
    }
  }

})
